<?php
namespace Admin\Model;

class UserModel extends CommonModel{

    protected $tableName = 'user';
    protected $fields    = array('openid', 'num', 'wxname', 'head', 'sex', 'name', 'phone', 'status', 'remark', 'lock', 'createtime', 'updatetime', 'logintime', 'ip');
    protected $_validate = array(
        array('openid', 'require', 'openid必须'),
        array('num', 'require', '用户编号必须'),
    );

    public function findUser($map, $fields = array()){
        return $this->Comm_find($map, $fields);
    }

    public function selectUser($map, $firstRow = 0, $listRows = 30, $fields = array(), $order){
        return $this->Comm_getList($map, $firstRow, $listRows, $fields, $order);
    }
    
    public function updateUser($data, $map){
        return $this->Comm_update($data, $map);
    }

    public function countUser($map){
        return $this->Comm_count($map);
    }
}
